package wsi.exp.exp3;

import org.rygh.core.model.common.Pair;
import org.rygh.core.xml.XmlPath;
import org.rygh.semantic.model.ex.PredicatePath;

public class PathMatchPair extends Pair<PredicatePath, XmlPath> {

	private double pcaConfidence = 1.;
	private double confidence = 1.;
	private int count = 0;
	private int total = 0;
	private int pcaTotal = 0;

	public PathMatchPair(PredicatePath path, XmlPath xpath) {
		super(path, xpath);

		assert path != null;
		assert xpath != null;
	}

	public boolean equalsTo(PathMatchPair p) {
		if (this == p)
			return true;

		if (!getPredicatePath().getKey().equals(p.getPredicatePath().getKey()))
			return false;

		// System.out.printf("xpath left %s, right %s\n", getXmlPath(),
		// p.getXmlPath());

		if (!getXmlPath().getValue().equals(p.getXmlPath().getValue()))
			return false;

		return true;
	}

	public double getConfidence() {
		return confidence;
	}

	public int getCount() {
		return count;
	}

	public double getPcaConfidence() {
		return pcaConfidence;
	}

	public int getPcaTotal() {
		return pcaTotal;
	}

	public PredicatePath getPredicatePath() {
		return getLeft();
	}

	public int getTotal() {
		return total;
	}

	public XmlPath getXmlPath() {
		return getRight();
	}

	public void setConfidence(double confidence) {
		this.confidence = confidence;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public void setPcaConfidence(double pcaConfidence) {
		this.pcaConfidence = pcaConfidence;
	}

	public void setPcaTotal(int pcaTotal) {
		this.pcaTotal = pcaTotal;
	}

	public void setTotal(int total) {
		this.total = total;
	}
}
